<html>
<head>
<title>TUnsharp</title>
<link rel="stylesheet" type="text/css" href="../../avisynth.css">
<!--
Automatically generated, don't change:
$Id: tunsharp.htm,v 1.1 2005/07/10 16:11:01 wilbertd Exp $ 
-->
</head>
<body>
<h1>TUnsharp</h1>
<h2>Abstract</h2>
<b>author:</b>    tritical
<br><b>version:</b>         0.9.3<br>
<b>download:</b>   <a href="http://bengal.missouri.edu/~kes25c/">http://bengal.missouri.edu/~kes25c/</a>
<br><b>category:</b>  Sharpen/Soften Plugins
<br><b>requirements:</b>&nbsp;
<ul>
  <li>YV12 &amp; YUY2 Colorspace</li>
</ul>

<p><b>license:</b> GPL</p>

<hr size=2 width="100%" align=center>

<!-- #EndTemplate -->
<h2>Description</h2>
<p>      TUnsharp is a basic sharpening filter that uses a couple different variations of unsharpmasking   and allows for controlled sharpening based on edge magnitude and min/max neighborhood value clipping.   The real reason for its existence is that it sports a gui with real time preview.</p>
<h3>Syntax</h3>
<p><code>TUnsharp</code> (clip, int <var>&quot;strength&quot;</var>, int <var>&quot;thresholdL&quot;</var>, int
<var>&quot;thresholdU&quot;</var>, int <var>&quot;type&quot;</var>, int <var>&quot;map&quot;</var>, int
<var>&quot;lim&quot;</var>, int <var>&quot;radius&quot;</var>, bool <var>&quot;gui&quot;</var>)</p>
<h3>PARAMETERS</h3>
<p><var>strength</var> - The strength of the sharpening. Range is from 0 to 512.</p>
<p>default = 100  (int)</p>
<p><var>thresholdL</var> - The lower edge magnitude threshold.  If the edge magnitude for a pixel is equal to or greater
than thresholdL then it will be sharpened.  Range is 0 to 255.</p>
<p>default = 2  (int)</p>
<p><var>thresholdU</var> - The upper edge magnitude threshold.  If the edge magnitude for a pixel is equal to or less than
thresholdU then it will be sharpened.  Range is from 0 to 255 and it must be at equal to or
greater then thresholdL or the filter becomes a slow nop.</p>
<p>default = 40  (int)</p>
<p><var>type</var> - Sets the type of sharpening or unsharpmasking operator.  Current options:</p>
<p>linear (5 point)  -  0<br>
             linear (9 point)  -  1<br>
             teager            -  2<br>
             cubic             -  3<br>
             rational          -  4<br>
             subtract          -  5<br>
             Xsharpen          -  6</p>
<p>default = 0  (int)</p>
<p><var>map</var> - Sets what type of output map if any.  Current options:</p>
<p>no map                          -  0<br>
             pixels to be sharpened shown    -  1<br>
                as white on current frame binary map, pixels to be        -  2<br>
                sharpened set to 255, others 0 on luma... all chroma set to 128.</p>
<p>default = 0  (int)</p>
<p><var>   lim</var> - If type less than 6, lim sets the maximum the final sharpened pixel value can deviate from the         min/max of the original 9 pixel neighborhood of the original image.  Range is from 0 to 256.</p>
<p>If <var> type</var> = 6 (XSharpen), then lim sets the maximum difference between the current pixel and the
min or max of the neighborhood (whichever is closer to the value of the current pixel) there
can be and still have the pixel be mapped. If the difference is larger then lim, the pixel
is passed through untouched and not mapped to the min or max of the neighborhood.</p>
<p>default = 2  (int)</p>
<p><var>radius</var> - Sets the radius of smoothing for producing the blurred clip.  The blurred clip is used for
edge magnitude detection and for getting the values of the unsharpmasking operators.  Larger
values will be slower but more effective against noise.  Possible settings are 1, 2, 3.</p>
<p>default = 2</p>
<p><var>gui</var> - Sets whether or not this instance of TUnsharp should have a gui.  Only one instance of TUnsharp         at a time can have a gui, but there can be multiple instances per script (as long as the others
don't have a gui, it will throw an error if you try to create a second instance with one).</p>
<p>The options included on the gui are:</p>
<p><var>strength</var>, <var>thresholdL</var>, <var>thresholdU</var>, <var>type</var>
and <var>map</var></p>
<p>Normal operation is you change an option on the gui, then you must advance at least one
frame in vdub to see the effect of the change. However, if you click the gui's PREVIEW button,
a new window will pop open with the current frame and allow for seeing changes real time as
you alter the filter parameters.  To change the current frame of the real time preview you must
change the frame in the vdub window.</p>
<p>The DEFAULTS button will reset all values to the values the filter was constructed with (i.e.         either the defaults or the values you set in your avisynth script).</p>
<p>The OK button will close the dialog window and the preview window if it is open.</p>
<p>default = false  (bool)</p>
<h2>Changelog</h2>
<p>   05/24/2005  v0.9.3<br>
- Fixed a few remaining thread sync/exit problems, hopefully for the last time</p>
<p>05/01/2005  v0.9.2<br>
+ Added XSharpen sharpening method</p>
<p>05/01/2005  v0.9.1<br>
- Fixed a lot of bugs related to the gui code (thread sync and thread exit problems)<br>
       + Release version now works fine</p>
<p>10/24/2004  v0.9<br>
- Initial release</p>
<p><kbd>$Date: 2005/07/10 16:11:01 $</kbd>
</p>
</body>
</html>
